package com.xsoft.demo4;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class RegisterActivity extends AppCompatActivity {
    private EditText nameEdt;
    private EditText phoneNumberEdt;
    private EditText passwordEdt;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        nameEdt = (EditText) findViewById(R.id.name_edt);
        phoneNumberEdt = (EditText) findViewById(R.id.phone_number_edt);
        passwordEdt = (EditText) findViewById(R.id.password_edt);
        findViewById(R.id.register).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                /*String name = nameEdt.getText().toString().trim();
                if (TextUtils.isEmpty(name)) {
                    Toast.makeText(RegisterActivity.this, "请输入姓名", Toast.LENGTH_SHORT).show();
                }
                String phoneNumber = phoneNumberEdt.getText().toString().trim();
                if (TextUtils.isEmpty(phoneNumber)) {
                    Toast.makeText(RegisterActivity.this, "请输入手机号", Toast.LENGTH_SHORT).show();
                }
                String password = passwordEdt.getText().toString().trim();
                if (TextUtils.isEmpty(password)) {
                    Toast.makeText(RegisterActivity.this, "请输入密码", Toast.LENGTH_SHORT).show();
                }
                new DataBaseHelper(RegisterActivity.this).insert(name, phoneNumber, password);*/
                startActivity(new Intent(RegisterActivity.this, LoginActivity.class));
            }
        });
    }
}
